import { defineStore } from 'pinia';

export const useMapStore = defineStore('map', {
  state: () => ({
    map: null,
    locationData: [],
    currentIndex: 0
  }),
  
  actions: {
    setMap(map) {
      this.map = map;
    },
    
    setLocationData(data) {
      this.locationData = data;
      this.currentIndex = 0;
    },
    
    addLocationData(data) {
      this.locationData.push(data);
    },
    
    updatePlaybackIndex() {
      if (this.currentIndex < this.locationData.length - 1) {
        this.currentIndex++;
      }
    },
    
    resetPlayback() {
      this.currentIndex = 0;
    }
  }
}); 